import Vue from "vue";
import Router from "vue-router";
import Home from "../pages/Home";
import Search from "../pages/Search";
import Login from "../pages/Login";
import Register from "../pages/Register";
import VueRouter from "vue-router";

Vue.use(Router);

// VueRouter.prototype.push=function(location,resolve,reject){
//   if(resole && reject){
//     originPush.call(this,location,resolve,reject)
//   }else{
//     originPush.call(this,location,()=>{},()=>{})
//   }
// }

// VueRouter.prototype.replace=function(location,resolve,reject){
//   if(resole && reject){
//     originReplace.call(this,location,resolve,reject)
//   }else{
//     originReplace.call(this,location,()=>{},()=>{})
//   }
// }


// 用meta来显示与隐藏展不展示footer
export default new Router({
  routes: [
    {
      path: "/",
      redirect: "/home",
    },
    {
      path: "/home",
      component: Home,
      meta:{show:true}
    },
    {
      path: "/search",
      component: Search,
      meta:{show:true},
      name:'search'
    },
    {
      path: "/login",
      component: Login,
      meta:{show:false}
    },
    {
      path: "/register",
      component: Register,
      meta:{show:false}
    }
  ]
});
